/**
java.util.Arrays

1.数组内容转字符串      

Arrays.toString(int [] array)

2.素组排序
Arrays.sort(int[] array)

3.数组二分查找
Arrays.binarySearch(int [] array,int value)

4.复制指定数组
Arrays.copyOf(int [] array,int length)

Arrays.copyOf(INT [] array,int from,int to)

System.arraycopy(Object src, int srcPos,Object dest,int destPos,int length);

5.判断数组是否相等   值相等就是真
Arrays.equels();

6.填充数组
Arrays.fill();


*@author leo
*@company leo's company
*@description java_study
2024年2月2日上午12:27:51
Administrator
 */

/*
package com.leo.第三章_方法和数组;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Random;
@SuppressWarnings("unused")
public class U3_L16_Array类常用方法 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//int [] array=new int [10];
		//random_array(array);
		// 选择包装类型  1 int  a char
		//char[] array_char=ysl_warp_array(array,"gogo");
		//ysl_fill_array(array_char);
		//arrays 字符串 数组类容
		//System.out.println(Arrays.toString(array_char));
		//ysl_copyof(array_char);
		
		//值相同就相同了。不管是不是在同一个代码块
		char []a= {'a','b'};
		ysl_array_euqal(a);
	}
	
	
	
	//public static void ysl_toString() {
	//	Arrays.toString(null)
	//}
	
	//随机数组
	public static int[] random_array(int[] array) {
		Random r=new Random();
		int len=array.length;
		for(int i=0;i<len;i++) {
			array[i]=48+r.nextInt(10);   //65 ,26   91     --    48      10    57
		}
		//arrays的std快速排序
		Arrays.sort(array);
		return array;
	}
	//int warp
	public static void ysl_warp_array(int []array,int key) {
		System.out.print("int_warp_method over:  [ ");
		for(int ele:array) {
			System.out.print(ele+" ");
		}
		System.out.println("]");
	}
	//char warp
	public static char[] ysl_warp_array(int []array,String key) {
		char[]array_char=new char[10];
		int i=0;
		System.out.print("char_warp_method over: ");
		for(int ele:array) {
			array_char[i]=(char)ele;
			i++;
			
		}
		System.out.println(Arrays.toString(array_char));
		return array_char;
	}
	//copy
	//填充 arrays.fill
	public static void ysl_fill_array(int []array){
		Arrays.fill(array,0,2,0);
	}
	public static void ysl_fill_array(char []array) {
		Arrays.fill(array, 0,3,'?');
	}
	public static void ysl_copyof(char[] array) {
		char[]sign= {'s','i','g','n',':','Y','S','L'};
		int len=array.length;
		if(array[len-1]!=0) {
			len=len+10;
		}
		char[] array_char_new=new char[len];
		System.arraycopy(array, 0, array_char_new, 0,array.length);
		System.arraycopy(sign, 0,array_char_new, len-8,8);
		System.out.println(Arrays.toString(array_char_new));
	}
	public static void ysl_array_euqal(char[] array) {
		char []a= {'a','b'};
		System.out.println(Arrays.equals(a, array));		
	}
}
*/


